{template header}

<script type="text/javascript" src="lib/swfupload/swfupload/swfupload.js"></script>
<script type="text/javascript" src="lib/swfupload/js/swfupload.queue.js"></script>
<script type="text/javascript" src="lib/swfupload/js/fileprogress.js"></script>
<script type="text/javascript" src="lib/swfupload/js/handlers.js"></script>
<script type="text/javascript">
		var swfu;

		window.onload = function() {
			var settings = {
				flash_url : "lib/swfupload/swfupload/swfupload.swf",//设置flash 文件
				upload_url: "http://local.iknowy.com/?p=members&a=upload_img",//服务端处理上传程序的文件
                                post_params: " ",//提交服务器的参数信息
				file_size_limit : "1 MB",//上传最大文件大小
				file_types : "*.jpg;*.gif;*.png",//上传类型
                                file_post_name: "Filedata",//服务端接收file的name
				file_types_description : "All Files",//所有文件夹
				file_upload_limit : 1,  //设置最多上传的文件的总数 0没有限制
				file_queue_limit : 0,
                                //定义停止按钮取消按钮ID
				custom_settings : {
					progressTarget : "fsUploadProgress"
				},
				debug: false,//调试信息
				
				// Button settings
				button_image_url: "image/images/add.jpg",
				button_width: "144",
				button_height: "44",
				button_placeholder_id: "spanButtonPlaceHolder",

                                file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,//是否选择完文件后就触发上传
                                upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,
				queue_complete_handler : queueComplete
			};

			swfu = new SWFUpload(settings);
                        swfu.stopped = false;
	     };
              //自定义file_dialog_complete_handler函数
                        function fileDialogComplete(numFilesSelected, numFilesQueued){
                            if (numFilesSelected > 0) {
                           }else{
                                    alert('没有选择文件');
                                }
                        }
                        //自定义上传完成后的函数
                        function uploadComplete(file){
							//alert(file.date);
                            if (swfu.getStats().files_queued === 0) {
                            }
                        }
                        //自定义上传函数
                         function upload(){
                            if( swfu.getStats().files_queued > 0 ){
                                swfu.startUpload();
                                setTimeout("ajax_img()",3000);
                                setTimeout("release_open()",3000);
                            }else{
                                alert('请选择要上传的文件');
                            }
                        }
                        //自定义停止函数
                        function stop(){
                           swfu.customSettings.queue_cancelled_flag = true;
                           swfu.stopUpload();
                        }
                        function ajax_img(){
                       	   $.ajax({
                                url: "?p=ajax&a=up_img_show",
                                type:'POST',
                                complete :function(){}, //請求完回調的函數，無論成功與失敗都會調用，在success後
                                dataType: 'json', //會把回傳的字符串自動轉換為json對象！
                                data: {},
                                error: function() { alert('Ajax request 發生錯誤');},
                                
                                success: function(response) {
                            		$("#release_imgs").attr('src',response.image_url);
                            		$("#zs_id").val(response.id);
                                }
                            });
                        }
                        function submit_img(){
                        	if($("#tb_check").attr('checked')== true){
                        		var tb_check = 1;
                        	} else {
                        		var tb_check = 2;
                			}
                     	    $.post('http://local.iknowy.com/?p=ajax&a=submit_img',{
                     	    	zs_id:$("#zs_id").val(),
                          		content:$("#content").val(),
                          		tb_check:tb_check
                      		},
                      		function (data) {	//回传函数
                          		if(data){
                          			congrats_open();
                              	}
                      		});
                                     		
                        }
	</script>
<div class="wrap">
    <div class="show_left">
    	<div class="show_user">
        	<a href="#" target="_blank"><img class="reflect" src="image/images/210-265.jpg" width="210" height="265" alt=""/></a>
            <h3><a href="#" target="_blank">Danny</a></h3>
        </div>
        <div class="show_datum">
        	<p>年龄：19岁</p>
            <p>身高：169CM</p>
            <p>体重：48KG</p>
            <p>三围：88-60-90</p>
        </div>
        <div class="show_three">
        	<div class="show_bj">
            	<a href="#" class="show_a">
                	<span class="c_2399e8">粉丝</span>
                    <span class="c_e7137c">178</span>
                </a>
            </div>
            <div class="show_bj">
            	<a href="#" class="show_a">
                	<span class="c_2399e8">图片</span>
                    <span class="c_e7137c">178</span>
                </a>
            </div>
            <div class="show_bj">
            	<a href="#" class="show_a">
                	<span class="c_2399e8">工作<br/>申请</span>
                    <span class="c_e7137c">178</span>
                </a>
            </div>
        </div>
        {if $_SESSION['mid']}
        <div class="show_attention">
        	<a href="javascript:upload_open();" class="upload upload_open">上传图片</a>
            <a href="#" class="gz_ask_for">工作申请</a>
        </div>
        {else}
	        <div class="show_attention">
	        	<a href="#" class="attention">加关注</a>
	        </div>
        {/if}
    </div>
    <div class="show_right" >
    	<div class="show_time">
        	<div class="show_data">7月31日</div>
            <ul class="show_ul">
            	<li>
                	<div class="show_img"><a href="#"><img src="image/images/264-185.jpg" width="264" height="185"/></a></div>
                    <p>今天去soho~~</p>
                    <a href="#" class="del" title="删除">删除</a>
                </li>
                <li>
                	<div class="show_img"><a href="#"><img src="image/images/264-185.jpg" width="264" height="185"/></a></div>
                    <p>今天去soho~~</p>
                    <a href="#" class="del" title="删除">删除</a>
                </li>
                <li>
                	<div class="show_img"><a href="#"><img src="image/images/264-185.jpg" width="264" height="185"/></a></div>
                    <p>今天去soho~~</p>
                    <a href="#" class="del" title="删除">删除</a>
                </li>
                <li>
                	<div class="show_img"><a href="#"><img src="image/images/264-185.jpg" width="264" height="185"/></a></div>
                    <p>今天去soho~~</p>
                    <a href="#" class="del" title="删除">删除</a>
                </li>
            </ul>
        </div>
    	<div class="show_time">
        	<div class="settled">7月31日入驻~</div>
        </div>
    </div>
</div>
<div id="popup"></div>
<!--选择上传图片-->
<div class="popup_main pm_a">
	<div class="addition_photo">
		<a href="javascript:upload_close();" class="close">关闭</a>
        <span id="spanButtonPlaceHolder"></span>
        <input onclick="upload();" type="button" class="upload_img"  value="">
  	  		
		<div id="divStatus">0 个文件已上传</div>
    </div>
    <div style="width:100%;text-align:center;padding-top:120px;" id="fsUploadProgress">
	</div>
</div>
<!--恭喜已上传成功-->
<div class="popup_main pm_b">
	<div class="succeed">
    	<a href="javascript:succeed_close();" class="close">关闭</a>
    	<h4>恭喜已上传成功</h4>
        <a href="javascript:congrats_open();" class="issue" title="发布图片">发布图片</a>
        <!--<a href="#" class="addition" title="为图片添加描述">为图片添加描述</a>-->
    </div>
</div>
<!--恭喜已发布成功-->
<div class="popup_main pm_c">
	<div class="congrats">
    	<a href="javascript:congrats_close();" class="close">关闭</a>
    	<h4>恭喜已发布成功</h4>
        <a href="#" class="look_up" title="查看效果">查看效果</a>
        <a href="javascript:upload_open();" class="continue" title="继续添加">继续添加</a>
        <p>你今天一共上传<span class="c_df1b7e">15</span>张姑娘图</p>
    </div>
</div>

<div class="release_main">
	<a href="javascript:release_close();" class="close">关闭</a>
   <div class="release_img"><img src="image/images/616-430.jpg" id="release_imgs" width="616" style="margin-left:100px;margin-top:30px;"></div>
   		<textarea name="content" cols="" rows="" id="content" class="text_area"></textarea>
      <input onClick="javascript:submit_img();" name="" class="issue" type="button">
      <div class="synchro"><input class="input_synchro" id="tb_check" name="tb_check" type="checkbox" value="" checked><label>同步</label><span class="synchro_sina">同步新浪微博</span><span class="synchro_tx">同步腾讯微博</span></div>
</div>
<input type="hidden" name="zs_id" id="zs_id" value=""/>
{template foot}
